package com.example.demo.Service;


import com.example.demo.Entity.Shelf;
import com.example.demo.Entity.Warehouse;

import java.util.List;
import java.util.Map;
import java.util.Optional;

public interface WarehouseService {

    // 创建一个新的 Warehouse
    Warehouse createWarehouse(Warehouse warehouse);

    //通过名字查找Warehouse
    public Map<String, Object> searchWarehouseByName(String name);

    // 通过 ID 获取 Warehouse
    Optional<Warehouse> getWarehouseById(Long id);

    // 获取所有的 Warehouse
    List<Warehouse> getAllWarehouses();

    // 更新 Warehouse
    Warehouse updateWarehouse(Long id, Warehouse warehouse);

    // 通过 ID 删除 Warehouse
    boolean deleteWarehouse(Long id);

    //通过名字查找并更新Warehouse
    public Map<String, Object> updateWarehouseByName(Warehouse warehouse);

    //获取所有的 Warehouse
    public Map<String, Object> getAllWarehouseList();

    //新建或更新仓库信息
    public Warehouse saveWarehouse(Warehouse warehouse);

    //通过名字找仓库
    Optional<Warehouse> findByName(String name);

    // 选择货架逻辑
    public Shelf selectShelf(Warehouse warehouse,Double itemWeight);


    Map<String, Object> findAllWarehouse();
}
